﻿@using System.Configuration
@model ThaireInvestmentWeb.WcfSerivce.UnitTrustHeaderDTO   
@{
    Layout = null;
}

@if (Model.Header != null && Model.Header.ListedStatus.ToUpper() == "LISTED")
{
    if (Model.Bids != null)
    {
        var grid = new WebGrid(source: Model.Bids);
    @grid.GetHtml(tableStyle: "tablelist", headerStyle: "headertable", displayHeader: @Model.Bids.Any(),
                      columns: grid.Columns(
                          grid.Column(header: "NO.", format: item => item.WebGrid.Rows.IndexOf(item) + 1, canSort: false),
                          grid.Column(columnName: "Bid", header: "Bid", canSort: false),
                          grid.Column(columnName: "Date", header: "Bid Date",
                   format: (item) => item.Date != null
                   ? item.Date.ToString("dd/MM/yyyy") : "", canSort: true))
             )
        ;
    }
}
else
{
    if (Model.Navs != null)
    {
        var grid = new WebGrid(source: Model.Navs);
    @grid.GetHtml(tableStyle: "tablelist", headerStyle: "headertable", displayHeader: @Model.Navs.Any(),
                      columns: grid.Columns(
                          grid.Column(header: "NO.", format: item => item.WebGrid.Rows.IndexOf(item) + 1, canSort: false),
                          grid.Column(columnName: "Nav", header: "Nav", canSort: false),
                          grid.Column(columnName: "Date", header: "Nav Date",
                   format: (item) => item.Date != null
                   ? item.Date.ToString("dd/MM/yyyy") : "", canSort: true))
             )
        ;
    }
}